#include "bh1750.h"
extern I2C_HandleTypeDef hi2c1;
void WRITE_BH1750(uint8_t cmd)
{  
   HAL_I2C_Master_Transmit(&hi2c1,WRITE_ADDR,&cmd,1,HAL_MAX_DELAY);
	  
}

void READ_BH1750(uint8_t*data)
{
HAL_I2C_Master_Receive(&hi2c1,READ_ADDR,data,2,HAL_MAX_DELAY);
}

uint16_t DATA_DEAL(uint8_t*data)
{
    uint16_t result=data[0];
	  result<<=8;
	  result+=data[1];
	  return result;
	
}

